<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>服装</title>
    <script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
</head>
<body>
<form id="fuz">
    <a href="index.html">回到首页</a>
    <input type="checkbox" name="fz" value="服装1">服装1
    <input type="checkbox" name="fz" value="服装2">服装2
    <input type="checkbox" name="fz" value="服装3">服装3
    <input type="checkbox" name="fz" value="服装4">服装4
    <input type="button" value="添加" id="add-btn"/>
    <input type="button" value="查看购物车" id="view"/>
</form>
    <script>
        $("#add-btn").click(function () {
            var d=$("#fuz").serialize();//通过序列化表单值，创建 url 编码文本字符串。
            $.ajax({
                url:"addList",
                type:"post",
                data:d,
                success:function (data) {
                    alert(data.status)
                }
            })
        })
        $("#view").click(function () {
            $.get("getGoods",function (data) {
                alert(data.goods);
            })
        })
    </script>
</body>
</html>